package com.lei.baselibrary.base.rx

import com.lei.baselibrary.base.common.ResultCode
import com.lei.baselibrary.base.data.protocol.BaseResp
import rx.Observable
import rx.functions.Func1
import java.util.*

/**
 * @ProjectName : MyMall
 * @Author : 雷金泷
 * @Time : 2021/2/25 11:34
 * @Description : 文件描述
 */
class BaseFuncBoolean<T>:Func1<BaseResp<T>,Observable<Boolean>> {
    override fun call(t: BaseResp<T>): Observable<Boolean> {
        if(t.status!= ResultCode.SUCCESS){
            return Observable.error(BaseException(t.status,t.Message))
        }
        return Observable.just(true)
    }


}